import http from "@/http";
import { CategoryModel, ListCategoryParm } from "./CategoryModel";
//新增
export const addCategoryApi = (parm:CategoryModel)=>{
    return http.post("/api/category",parm)
}
//列表
export const getListApi = (parm:ListCategoryParm)=>{
    return http.get("/api/category",parm)
}
//编辑
export const editCategoryApi = (parm:CategoryModel)=>{
    const url = `api/category/${parm.categoryId}`
    return http.post(url,parm)
}
//删除
export const deleteCategoryApi = (categoryId:string)=>{
    return http.get(`api/category/${categoryId}`)
}
//获取在添加商品时的下拉列表
export const getSelectListApi = ()=>{
    return http.get("/api/category/list")
}